package com.bmd.backgroundmanger.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.bmd.backgroundmanger.entity.Question;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 题目Service接口
 */
public interface IQuestionService extends IService<Question> {

    /**
     * 根据分类ID查询题目
     */
    List<Question> getQuestionsByCategoryId(Integer categoryId);

    /**
     * 根据难度级别查询题目
     */
    List<Question> getQuestionsByDifficultyLevel(String difficultyLevel);

    /**
     * 搜索题目
     */
    List<Question> searchQuestions(String keyword);

    /**
     * 随机获取题目
     */
    Question getRandomQuestion();

    @Transactional
    boolean removeById(Integer questionId);

    @Transactional
    boolean removeByIds(List<Integer> questionIds);
}